<script language="Javascript">
function submitForm() {
tinyMCE.triggerSave();
document.forms[0].submit();
</script>
<?php if (($go == "draft") || ($go == "missing") || ($go == "make-changes")) { ?>
<p><?php if (($action == "edit") || ($go == "missing")) echo "Edit"; ?> Module <?php echo $mid; ?>, Theme <?php echo $row_themes['theme_num']; ?> content to <?php echo $row_courses['jiu_course_id'].": ".$row_courses['name']; ?>.</p>
<?php if ($go == "missing") echo "<div class='error_msg'>Please make sure theme content is present.</div>"; ?>
<div class="stacked">
<span class="icon"><img src="images/disk.png" border="0" align="absmiddle" /></span><input id="Submit" name="Submit" type="submit" class="save_progress_form" value="<?php if (($action == "edit") || ($go == "missing")) echo "Update"; else echo "Save"; ?>">
</div>
<table class="dataTable">
    <tr style="background-color: <?php echo $color1; ?>">
        <td class="dataLabel">Theme Title:</td>
        <td class="data">
        <input id="theme_title" name="theme_title" type="text" size="50" value="<?php echo $row_themes['theme_title']; ?>">
        </td>
    </tr>
    <tr style="background-color: <?php echo $color2; ?>">
    	<td class="help_text" colspan="2"><p>Compose or copy/paste the Theme's content below. Use the &quot;format&quot; drop-down list to define headings. Click the "<?php if (($action == "edit") || ($go == "missing")) echo "Update"; else echo "Save"; ?>"  button above to save your work.</p></tr>
<tr style="background-color: <?php echo $color2; ?>">
	<td class="dataLabel">Theme Content:</td>
    <td class="data">
    <textarea id="theme_text" name="theme_text" type="text" cols="110" rows="35"><?php if (($action == "edit") || ($row_themes['theme_text'] != "")) echo $row_themes['theme_text']; ?></textarea>
    </td>
</tr>
</table>
<input name="theme_num" type="hidden" value="<?php echo $row_themes['theme_num']; ?>" />
<input name="vid" type="hidden" value="<?php if ($action == "add") echo "1"; elseif (((($action == "edit") || ($action == "review")) || ($go == "missing"))  && ($vid != "default")) echo ($row_themes['vid']); else echo ($row_themes['vid'] + 1); ?>" />
<?php } ?>
<?php if ($go == "confirm") { ?>
<div class="error_msg">Theme content saved.</div>
<p>Are you finished with adding/editing this theme? A preview version is below for your review.</p>
<div class="stacked">
	<span class="icon"><img src="images/page_edit.png" border="0" align="absmiddle" /></span><a href="index.php?section=module_theme&amp;action=review&go=draft&amp;view=course_detail&amp;dbTable=themes&amp;cid=<?php echo $cid; ?>&amp;mid=<?php echo $mid; ?>&amp;vid=<?php echo $row_themes['vid']; ?>&amp;id=<?php echo $id; ?>&amp;modal_window=<?php echo $modal_window; ?>">No, I wish to continue adding to or editing this theme</a>
</div>
<div class="stacked">
	<span class="icon"><img src="images/tick.png" border="0" align="absmiddle" /></span>Yes, I have finished
</div>
<div id="preview">
<h1><?php echo "Module ".$mid.", Theme ".$row_themes['theme_num'].": ".$row_themes['theme_title']; ?></h1>
<?php echo $row_themes['theme_text']; ?>
</div>
<?php } ?>
